package lm.concurrency.day2.synchronizedDemos;

/**
 * @Auther: Min.Liu
 * @Description:
 * @Date: Created in 11:00 2024/11/5
 */
class Room {
    int value = 0;

    public void increment() {
        synchronized (this) {
            value++;
        }
    }

    public void decrement() {
        synchronized (this) {
            value--;
        }
    }

    public int get() {
        synchronized (this) {
            return value;
        }
    }
}
